In the event of subjecting a video stream or audio stream to TS (Transport Stream) packetizing and multiplexing using the MPEG (Moving Picture Expert Group) method, a standard model (system target decoder (STD)) serving as a decoder is assumed, and encoding processing is performed so as to perform decoding processing correctly with this STD.
For example, with Patent Document 1, technology has been disclosed wherein, assuming an STD model shown in FIG. 2, an encoding apparatus such as shown in FIG. 1 subjects an elementary stream to TS packetizing to generate an MPEG transport stream.
The encoding apparatus shown in FIG. 1 comprises an access unit detector 1, a pseudo-access-unit calculator 2, a packetizer 3, and a scheduler 4. Also, the STD model shown in FIG. 2 comprises a previous-stage buffer 21, a subsequent-stage buffer 22, and a decoder 23.
The access unit detector 1 of the encoding apparatus obtains an access unit from an elementary stream, and detects the size and decoding point-in-time information of the access unit thereof. When dividing an access unit into pseudo-access units having a predetermined size depending on the size of the previous-stage buffer 21 shown in FIG. 2, and a data transfer rate as to the previous-stage buffer 21, the pseudo-access-unit calculator 2 calculates point-in-time when the pseudo-access unit thereof is input to the previous-stage buffer 21 (input completed point-in-time) (decoded point-in-time of the pseudo-access unit). The scheduler 4 calculates point-in-time when a multiplexed stream is supplied to the decoder (clock reference) and the size of a packet (packet size) based on the size of the pseudo-access unit and the pseudo-decoding point-in-time.
The packetizer 3 packetizes the elementary stream in accordance with the packet size, encodes the decoded point-in-time and the clock reference, and generates an MPEG transport stream. The generated MPEG transport stream is sent via a transmission path 5, or recorded in a recording medium 5.
Incidentally, in the event of subjecting an audio stream to TS packetizing using the MPEG method, and multiplexing the packetized TS packets into one transport stream, the audio stream thereof has been already encoded with a predetermined encoding method beforehand. Examples of this encoding method include a fixed-length encoding method and a variable-length encoding method.
Consequently, a situation can be conceived wherein two audio streams encoded with different encoding methods are multiplexed into one transport stream.
[Patent Document 1] Japanese Unexamined Patent Application Publication No. 9-261604